import Vue from "vue";
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
        //属性
        language: 'EN',
        balance: 0,//钱包余额
        currency: 'ARK',// 币种
        token:'', // 登录鉴权
        wallet:'',


    },
    getters: {
        getLanguage: state => state.language,
        getBalance: state => state.balance,
        getCurrency: state => state.currency,
        getToken: state => state.token,
        getWallet: state => state.wallet,

    },
    mutations: {
        //set方法
        setLanguage(state, language) {
            state.language = language
        },
        setBalance: (state, value) => {
            state.balance = value
        },
        setCurrency: (state, value) => {
            state.currency = value
        },
        setToken: (state, value) => {
            state.token = value
        },
        setWallet: (state, value) => {
            state.wallet = value
        }
    }
})
export default store;
